import request from "@/utils/request";

// 查询设备维修列表
export function listRepair(query) {
  return request({
    url: "/mes/pro/repair/list",
    method: "get",
    params: query,
  });
}

// 查询设备维修详细
export function getRepair(id) {
  return request({
    url: "/mes/pro/repair/" + id,
    method: "get",
  });
}

// 新增设备维修
export function addRepair(data) {
  return request({
    url: "/mes/pro/repair",
    method: "post",
    data: data,
  });
}

// 修改设备维修
export function updateRepair(data) {
  return request({
    url: "/mes/pro/repair",
    method: "put",
    data: data,
  });
}

// 删除设备维修
export function delRepair(id) {
  return request({
    url: "/mes/pro/repair/" + id,
    method: "delete",
  });
}

//查询工单信息
export function getWorkorder(query) {
  return request({
    url: "/mes/pro/workorder/list",
    method: "get",
    params: query,
  });
}

//请求模板下拉数据
export function getTemplate(query) {
  return request({
    url: "/mes/qc/qctemplate/list",
    method: "get",
    params: query,
  });
}

//获取模板列表
export function getTemplateList(query) {
  return request({
    url: "/mes/qc/templateindex/getTemplateIndexList",
    method: "get",
    params: query,
  });
}

//根据sn编码回显数据
export function getInfoBySnCode(snCode) {
  return request({
    url: `/mes/pro/order/getworkorderSn/${snCode}`,
    method: "get",
    // params: query,
  });
}

//add begin by zyj 2024/11/21 删除更换物料
export function delRepairMaterial(id) {
  return request({
    url: "/mes/pro/repair/removeRepairItem/" + id,
    method: "delete",
  });
}
//add end by zyj 2024/11/21 删除更换物料
